<%@ page import="databeans.*"%>
<%@ page import="java.util.*" %>

<% 
  String customerID = (String)request.getAttribute("customerID");
  if (customerID!=null){
%>
<script>
$('#pmt-history').colorize({ hoverColor:'none', ignoreHeaders :true, hiliteColor :'none' });
</script>
<div id="box">
   	<h3>Payment History</h3>
   	<jsp:include page="../common/messages.jsp"/>
   	<% 
   		ArrayList<Integer> transIDs = (ArrayList<Integer>)request.getAttribute("transIDs");
		ArrayList<String> transDates = (ArrayList<String>)request.getAttribute("transDates");
		ArrayList<String> transTypes = (ArrayList<String>)request.getAttribute("transTypes");
		ArrayList<Long> amounts = (ArrayList<Long>)request.getAttribute("amounts");
		ArrayList<String> statuses = (ArrayList<String>)request.getAttribute("statuses"); 
		if (transTypes.size()==0){
	  %>
	  <p>You have no check transactions so far... </p>
	 <% 
	 	}else{
	 %>
     	<div class="trans-history">
    		<table id="pmt-history">
    			<thead>
					<tr>
						<th>ID</th>
						<th>Date</th>
					    <th>Type</th>
					    <th>$ Amount</th>
					    <th>Status</th>
					</tr>
				</thead>
			<tbody>
			<%for(int i=0; i<transTypes.size(); i++){ %>
				<tr>
					<td><%=transIDs.get(i) %></td>
					<td><%=transDates.get(i).toString()%></td>
					<td><%=transTypes.get(i) %></td>
					<td style="text-align:right;padding-right:10px;">$<%=helper.Formatter.prepCashToView(amounts.get(i)) %></td>
					<td>
						<%if(statuses.get(i).equals("Pending")) { %>
							<span class="pending pad-left-20">Pending</span>
						<%}else if(statuses.get(i).equals("Approved")){ %>
							<span class="tick pad-left-20">Approved</span>
						<%} %>
					</td>
				</tr>
			<% } %>
			</tbody>
		</table>
   	</div>
    	<% } %>
</div>
<%} %>

